package com.itheima.stargraph.controller;

import com.itheima.stargraph.dto.common.Result;
import com.itheima.stargraph.dto.request.Text2ImageReqDto;
import com.itheima.stargraph.dto.respone.Text2ImageResDto;
import com.itheima.stargraph.service.Text2ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Author mr.wu
 * @Data #{DATE} #{TIME}
 */
@RestController
@RequestMapping("/api/authed/1.0/t2i")
public class TextToImageController {
    @Autowired
    private Text2ImageService text2ImageService;


    /**
     * 添加comfyui流程任务（工作流任务）
     * @param dto
     * @return
     */
    @PostMapping("/prompt")
    public Result<Text2ImageResDto> prompt(@RequestBody Text2ImageReqDto dto) {

        Text2ImageResDto resDto = text2ImageService.prompt(dto);
        return Result.ok(resDto);
    }
}
